home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / pull20.zip / PULLWORK.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-11  |  4KB  |  111 lines

  1. { =========================================================================== }
  2. { Pullwork.pas - Work Window procedures for main work area. ver 2.0, 01-12-87 }
  3. {                                                                             }
  4. { This file contains all the procedures executed for the Work Window.  These  }
  5. { are the main steps of your program.  They are organized by WorkWindowStep   }
  6. { number.                                                                     }
  7. { (c) 1987, 1988 James H. LeMay                                               }
  8. { =========================================================================== }
  9.  
  10. {$R-,S-,I-,D-,T-,F-,V-,B-,N-,L+ }
  11.  
  12. UNIT PullWork;
  13.  
  14. INTERFACE
  15.  
  16. uses
  17.   CRT,Qwik,WndwVars,Wndw,PullVars,Pull,PullStat,PullProc;
  18.  
  19. procedure WorkWndw;
  20.  
  21. IMPLEMENTATION
  22.  
  23. { *****************************    STEP 7   ********************************* }
  24. { This procedure will have all the procedures for the Work window(s). }
  25.  
  26. procedure ClearRow (Row: byte);
  27. begin
  28.   Qfill (Row,2,1,CRTcols-2,-1,' ');
  29. end;
  30.  
  31. procedure WorkWndw;
  32. var TempString: MaxString;
  33.     i,j:        byte;
  34. begin
  35.   ShowMsg (1);
  36.   if TopWndwStat.WSname=Window1 then
  37.     begin
  38.       Qfill  (18,46,1,12,yellow+MagentaBG,' ');
  39.       Qwrite (18,24,-1,'File name selected  = '+FileName);
  40.     end;
  41.   case WorkWndwStep of
  42.     0:  begin
  43.           DataPad.NewData:=true;  { Clear pad for new entry }
  44.           ClearRow (20);
  45.           Str    (WorkWndwInteger:4,TempString);
  46.           Qwrite (19,24,-1,'Work window integer = '+TempString);
  47.           Qwrite (20,27,-1,'Press CR to enter new value:');
  48.           GotoRC (20,55);
  49.           ReadKbd (ExtKey,Key);
  50.           if HelpKeyPressed then PullHelpWndw (1,'work window');
  51.           if Key=RetKey then
  52.             begin
  53.               WorkWndwStep:=1;
  54.               ClearRow (20);
  55.               Qwrite (20,29,-1,'Enter integer:')
  56.             end
  57.         end;
  58.     1:  begin
  59.           repeat
  60.             WorkWndwEntry (20,46,4,WorkWndwInteger,Integers,Right,
  61.                            ord(NumericHW),'Work window entry');
  62.             if (WorkWndwInteger<-300) or (WorkWndwInteger>4000) then
  63.               RestoreData (WorkWndwInteger,4);       { Sets Key=#00 }
  64.           until DataPad.DataStored or (Key>#00);
  65.           if Key=RetKey then
  66.             begin
  67.               ClearRow (20);
  68.               Str    (WorkWndwInteger:4,TempString);
  69.               Qwrite (19,46,-1,TempString);
  70.               Qwrite (20,22,-1,'Press CR for multi-level work windows:');
  71.               GotoRC (20,60);
  72.               WorkWndwStep:=2
  73.             end
  74.         end;
  75.     2:  begin
  76.           ReadKbd (ExtKey,Key);
  77.           if HelpKeyPressed then PullHelpWndw (1,'work window');
  78.           if Key=RetKey then
  79.             begin
  80.               for i:=0 to 1 do
  81.                 for j:=0 to 4 do
  82.                 begin
  83.                   MakeWindow (5+j*2+i*2,23+j*8-i*18,8,21,black+GreenBG,
  84.                               lightgreen+BlackBG,SingleBrdr,aWindow);
  85.                   Str (LI,TempString);
  86.                   TitleWindow (Top,Center,' Work Window '+TempString+' ');
  87.                   with TopWndwStat do
  88.                     begin
  89.                       Qwrite (WSrow+3,WScol+5, -1,'Press CR or');
  90.                       Qwrite (WSrow+4,WScol+5, -1,'pull menus')
  91.                     end
  92.                 end;
  93.               WorkWndwStep:=3
  94.             end
  95.         end;
  96.     3:  begin
  97.           ReadKbd (ExtKey,Key);
  98.           if HelpKeyPressed then PullHelpWndw (1,'work window');
  99.           if Key=RetKey then
  100.             begin
  101.               for i:=LI downto 2 do RemoveWindow;
  102.               WorkWndwStep:=0
  103.             end
  104.         end;
  105.   end  { case }
  106. end;
  107.  
  108. BEGIN
  109.   AddrWorkWndw:=@WorkWndw;
  110. END.
  111.